package com.wsjc.manager.dao.city.impl;

import java.util.Map;

import org.springframework.stereotype.Repository;

import com.beust.jcommander.internal.Maps;
import com.wsjc.common.core.dao.impl.BaseDaoImpl;
import com.wsjc.manager.dao.city.WjCityDao;
import com.wsjc.manager.entity.WjCity;

@Repository
public class WjCityDaoImpl extends BaseDaoImpl<WjCity> implements WjCityDao{

	@Override
	public void updateBaiDuName(String provinceName, String cityName) {
		
		Map<String, String> params = Maps.newHashMap();
		params.put("baiduName", cityName);
		
		// 条件
		provinceName = provinceName.substring(0, provinceName.length());
		params.put("provinceName", provinceName);
		cityName = cityName.substring(0, cityName.length()-1);
		params.put("cityName", cityName);
		this.getSessionTemplate().update(getStatement("updateName"),params);
	}
	
	@Override
	public void updateGaoDeName(String provinceName, String cityName) {
		
		Map<String, String> params = Maps.newHashMap();
		params.put("gaodeName", cityName);
		
		// 条件
		provinceName = provinceName.substring(0, provinceName.length());
		params.put("provinceName", provinceName);
		cityName = cityName.substring(0, cityName.length()-1);
		params.put("cityName", cityName);
		this.getSessionTemplate().update(getStatement("updateName"),params);
	}
	
	
	
}
